<?php
	class Checkuser
    {
        var $username;
        var $validKey;
        function Checkuser()
        {
            $this->CI = &get_instance();   
            $this->CI->load->library('session');                                 
        }
        
        function CheckUserLogin()
        {
            $username = $this->CI->session->userdata('username');
            $this->validKey = $this->CI->session->userdata('validKey');
            $validated = $this->CI->session->userdata('validated'); 
            if(empty($username) || !$validated) 
               redirect('login/adminlogin', 'refresh');            
        }
    }
?>